package net.wofly.right.util;

/**
 * Created by LiuJianbo on 2017/9/26.
 */
public enum RoleEnum {
    
    库管("104", "库管"),
    店员("105", "店员"),
    业务员("106", "业务员"),
    团购专员("107", "团购专员"),
    内部员工("100", "内部员工"),
    老板("101", "老板"),
    会计("102", "会计"),
    出纳("103", "出纳"),
    客户("200", "客户"),
    会员客户("201", "会员客户"),
    团购客户("202", "团购客户"),
    流通客户("203", "流通客户"),
    酒店客户("204", "酒店客户"),
    签单客户("205", "签单客户");
    
    private String value;
    private String name;
    
    private RoleEnum(String value, String name) {
        this.value = value;
        this.name = name;
    }
    
    public static boolean isValueCorrect(Integer value) {
        for (RoleEnum forEnum : values()) {
            if (value.equals(forEnum.getValue())) {
                return true;
            }
        }
        return false;
    }
    
    public static String getName(Integer value) {
        for (RoleEnum forEnum : values()) {
            if (value.toString().equals(forEnum.getValue())) {
                return forEnum.name;
            }
        }
        return null;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public String  getValue() {
        return value;
    }
    
    public void setValue(String value) {
        this.value = value;
    }
    
}
